﻿/// ****************************************************************************
/// Author:	        Robin Zhu
/// Create Date:	2013-8-27
/// Purpose: 		用于用户缓存管理的静态类
/// ****************************************************************************
/// Modify By		Date			Remark
/// ****************************************************************************
/// 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RB.Web.Security
{
    internal static class UserCacheManager
    {
        private static Dictionary<string, Dictionary<string, object>> _caches = new Dictionary<string, Dictionary<string, object>>();

        internal static IDictionary<string, object> Get(string ticket)
        {
            Dictionary<string, object> result = null;
            if (!_caches.ContainsKey(ticket))
            {
                result = new Dictionary<string, object>();
                _caches.Add(ticket, result);
            }
            else
            {
                result = _caches[ticket];
            }
            return result;
        }

        internal static void Remove(string ticket)
        {
            if (_caches.ContainsKey(ticket))
            {
                _caches.Remove(ticket);
            }
        }
    }
}
